#pragma once

#ifndef decle_property_database_literal

#define decle_property_database_literal( literal_name, literal_value ) \
template< typename CharType > \
struct literal_name \
{ \
	static inline CharType const * literal() { return literal_value ; }; \
}; \
template<> \
struct literal_name##<wchar_t> \
{ \
	static inline wchar_t const * literal() { return L##literal_value ; } \
};

#endif


namespace umtl
{
	namespace property_database_literal
	{
		decle_property_database_literal( create_table, "create table property_table ( name nvarchar primary key, value nvarchar );" );
		decle_property_database_literal( set1, "insert into property_table ( name, value ) values( '" );
		decle_property_database_literal( set2, "', '" );
		decle_property_database_literal( set3, "' );" );
		decle_property_database_literal( remove1, "delete from property_table where name = '" );
		decle_property_database_literal( remove2, "';" );
		decle_property_database_literal( get1, "select value from property_table where name = '" );
		decle_property_database_literal( get2, "';" );
		decle_property_database_literal( exists_table, "select sql from sqlite_master where name='property_table';" );
		decle_property_database_literal( update1, "update property_table set value = '" );
		decle_property_database_literal( update2, "' where name = '" );
		decle_property_database_literal( update3, "';" );
	}
}